package org.acra.b;

import android.util.SparseArray;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;

public class l
{
  private static final String[] a;
  private static final String[] b;
  private static final String[] c;
  private static final String[] d;
  private static Class e;
  private static Method f;
  private static Class g;
  private static Method h;
  private static Method i;
  private static Method j;
  private static Method k;
  private static Class l;
  private static Field m;
  private static Field n;
  private static Field o;
  private static Field p;
  private static SparseArray q;
  private static SparseArray r;
  private static SparseArray s;
  private static SparseArray t;
  private static SparseArray u;
  private static SparseArray v;
  private static SparseArray w;
  private static SparseArray x;

  static
  {
    int i1 = 0;
    a = new String[] { "mp4", "mpeg4", "MP4", "MPEG4" };
    b = new String[] { "avc", "h264", "AVC", "H264" };
    c = new String[] { "h263", "H263" };
    d = new String[] { "aac", "AAC" };
    e = null;
    f = null;
    g = null;
    h = null;
    i = null;
    j = null;
    k = null;
    l = null;
    m = null;
    n = null;
    o = null;
    p = null;
    q = new SparseArray();
    r = new SparseArray();
    s = new SparseArray();
    t = new SparseArray();
    u = new SparseArray();
    v = new SparseArray();
    w = new SparseArray();
    x = new SparseArray();
    try
    {
      e = Class.forName("android.media.MediaCodecList");
      Class localClass1 = e;
      Class[] arrayOfClass = new Class[1];
      arrayOfClass[0] = Integer.TYPE;
      f = localClass1.getMethod("getCodecInfoAt", arrayOfClass);
      g = Class.forName("android.media.MediaCodecInfo");
      h = g.getMethod("getName", new Class[0]);
      i = g.getMethod("isEncoder", new Class[0]);
      j = g.getMethod("getSupportedTypes", new Class[0]);
      k = g.getMethod("getCapabilitiesForType", new Class[] { String.class });
      l = Class.forName("android.media.MediaCodecInfo$CodecCapabilities");
      m = l.getField("colorFormats");
      n = l.getField("profileLevels");
      Field[] arrayOfField1 = l.getFields();
      int i2 = arrayOfField1.length;
      int i3 = 0;
      Class localClass2;
      Field[] arrayOfField2;
      int i4;
      if (i3 < i2)
      {
        Field localField1 = arrayOfField1[i3];
        if ((Modifier.isStatic(localField1.getModifiers())) && (Modifier.isFinal(localField1.getModifiers())) && (localField1.getName().startsWith("COLOR_")))
          q.put(localField1.getInt(null), localField1.getName());
      }
      else
      {
        localClass2 = Class.forName("android.media.MediaCodecInfo$CodecProfileLevel");
        arrayOfField2 = localClass2.getFields();
        i4 = arrayOfField2.length;
      }
      while (true)
      {
        if (i1 < i4)
        {
          Field localField2 = arrayOfField2[i1];
          if ((Modifier.isStatic(localField2.getModifiers())) && (Modifier.isFinal(localField2.getModifiers())))
            if (localField2.getName().startsWith("AVCLevel"))
              r.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("AVCProfile"))
              s.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("H263Level"))
              t.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("H263Profile"))
              u.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("MPEG4Level"))
              v.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("MPEG4Profile"))
              w.put(localField2.getInt(null), localField2.getName());
            else if (localField2.getName().startsWith("AAC"))
              x.put(localField2.getInt(null), localField2.getName());
        }
        else
        {
          o = localClass2.getField("profile");
          p = localClass2.getField("level");
          return;
          i3++;
          break;
        }
        i1++;
      }
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
    }
    catch (SecurityException localSecurityException)
    {
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
    }
  }

  public static String a()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    if ((e != null) && (g != null));
    try
    {
      int i1 = ((Integer)e.getMethod("getCodecCount", new Class[0]).invoke(null, new Object[0])).intValue();
      for (int i2 = 0; i2 < i1; i2++)
      {
        localStringBuilder.append("\n");
        Method localMethod = f;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = Integer.valueOf(i2);
        Object localObject = localMethod.invoke(null, arrayOfObject);
        localStringBuilder.append(i2).append(": ").append(h.invoke(localObject, new Object[0])).append("\n");
        localStringBuilder.append("isEncoder: ").append(i.invoke(localObject, new Object[0])).append("\n");
        String[] arrayOfString = (String[])j.invoke(localObject, new Object[0]);
        localStringBuilder.append("Supported types: ").append(Arrays.toString(arrayOfString)).append("\n");
        int i3 = arrayOfString.length;
        for (int i4 = 0; i4 < i3; i4++)
          localStringBuilder.append(a(localObject, arrayOfString[i4]));
        localStringBuilder.append("\n");
      }
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      return localStringBuilder.toString();
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      break label248;
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      label248: break label248;
    }
  }

  private static String a(Object paramObject, String paramString)
  {
    int i1 = 0;
    StringBuilder localStringBuilder = new StringBuilder();
    Object localObject = k.invoke(paramObject, new Object[] { paramString });
    int[] arrayOfInt = (int[])m.get(localObject);
    if (arrayOfInt.length > 0)
    {
      localStringBuilder.append(paramString).append(" color formats:");
      for (int i4 = 0; i4 < arrayOfInt.length; i4++)
      {
        localStringBuilder.append((String)q.get(arrayOfInt[i4]));
        if (i4 < -1 + arrayOfInt.length)
          localStringBuilder.append(',');
      }
      localStringBuilder.append("\n");
    }
    Object[] arrayOfObject = (Object[])n.get(localObject);
    if (arrayOfObject.length > 0)
    {
      localStringBuilder.append(paramString).append(" profile levels:");
      if (i1 < arrayOfObject.length)
      {
        n localn = a(paramObject);
        int i2 = o.getInt(arrayOfObject[i1]);
        int i3 = p.getInt(arrayOfObject[i1]);
        if (localn == null)
          localStringBuilder.append(i2).append('-').append(i3);
        switch (m.a[localn.ordinal()])
        {
        default:
        case 1:
        case 2:
        case 3:
        case 4:
        }
        while (true)
        {
          if (i1 < -1 + arrayOfObject.length)
            localStringBuilder.append(',');
          i1++;
          break;
          localStringBuilder.append(i2).append((String)s.get(i2)).append('-').append((String)r.get(i3));
          continue;
          localStringBuilder.append((String)u.get(i2)).append('-').append((String)t.get(i3));
          continue;
          localStringBuilder.append((String)w.get(i2)).append('-').append((String)v.get(i3));
          continue;
          localStringBuilder.append((String)x.get(i2));
        }
      }
      localStringBuilder.append("\n");
    }
    return "\n";
  }

  private static n a(Object paramObject)
  {
    int i1 = 0;
    String str = (String)h.invoke(paramObject, new Object[0]);
    String[] arrayOfString1 = b;
    int i2 = arrayOfString1.length;
    for (int i3 = 0; i3 < i2; i3++)
      if (str.contains(arrayOfString1[i3]))
        return n.a;
    String[] arrayOfString2 = c;
    int i4 = arrayOfString2.length;
    for (int i5 = 0; i5 < i4; i5++)
      if (str.contains(arrayOfString2[i5]))
        return n.b;
    String[] arrayOfString3 = a;
    int i6 = arrayOfString3.length;
    for (int i7 = 0; i7 < i6; i7++)
      if (str.contains(arrayOfString3[i7]))
        return n.c;
    String[] arrayOfString4 = d;
    int i8 = arrayOfString4.length;
    while (i1 < i8)
    {
      if (str.contains(arrayOfString4[i1]))
        return n.d;
      i1++;
    }
    return null;
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     org.acra.b.l
 * JD-Core Version:    0.6.2
 */